//
//  FPWillPlayTableViewCell.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/13.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPWillPlayTableViewCell.h"
#define imageWidth (kScreenWidth - 30) / 3

@implementation FPWillPlayTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self B_TopView];
    }
    return self;
}

// 创建顶部视图
- (void)B_TopView
{
    // 日期
    self.dateLabel = [UILabel labelWithFrame:CGRectMake(kImageW(15),kImageH(15),kImageW(35), kImageH(10)) text:@"16日" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [self.contentView addSubview:_dateLabel];
    
    // 影片海报
    self.displayImageView = [UIImageView imageViewWithframe:CGRectMake(kImageW(50), kImageH(15), (kScreenWidth - 30) / 4, (kScreenHeight - 120) / 4 ) imageName:@"key-vector" cornerRadius:0 bordeWidth:0 backgroundColor:[UIColor whiteColor]];
    [self.contentView addSubview:_displayImageView];
    
    // 影片名
    self.filmNameLabel = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(30), kImageH(15), kImageW(200), kImageH(30)) text:@"捉妖记" fontSize:18.0 fontWeight:2.0 color:[UIColor blackColor]];
    [self.contentView addSubview:_filmNameLabel];
    
    // 想观看的人数
    self.wantedCountLabel = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(30), kImageH(50), kImageW(50), kImageH(10)) text:@"6666" fontSize:12.0 fontWeight:1.0 color:[UIColor orangeColor]];
    [self.contentView addSubview:_wantedCountLabel];
    
    // 想看人数标签
    UILabel *peopleLabel = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(60), kImageH(50), kImageW(70), kImageH(10)) text:@"人想看 - " fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [self.contentView addSubview:peopleLabel];
    
    // 影片类型
    self.typeLabel = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(110), kImageH(50), kImageW(100), kImageH(10)) text:@"科幻|喜剧" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [self.contentView addSubview:_typeLabel];
    
    // 导演和演员标签
    UILabel *label1 = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(30), kImageH(70), kImageW(30), kImageH(10)) text:@"导演:" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [self.contentView addSubview:label1];
    
    UILabel *label2 = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(30), kImageH(90), kImageW(90), kImageH(10)) text:@"演员:" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [self.contentView addSubview:label2];
    
    // 导演
    self.directLabel = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(60), kImageH(70), kImageW(100), kImageH(10)) text:@"董成鹏" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [self.contentView addSubview:_directLabel];
    
    // 演员
    self.actorLabel = [UILabel labelWithFrame:CGRectMake(imageWidth + kImageW(60), kImageH(90), kImageW(100), kImageH(10)) text:@"董成鹏/袁珊珊" fontSize:12.0 fontWeight:1.0 color:[UIColor lightGrayColor]];
    [self.contentView addSubview:_actorLabel];
    
    // 超前预售/上映提醒
    self.aheadShopButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.aheadShopButton.frame = CGRectMake(imageWidth + kImageW(30), kImageH(120), kScreenWidth / 4, kImageH(30));
    [self.aheadShopButton setTitle:@"超前预售" forState:UIControlStateNormal];
    self.aheadShopButton.backgroundColor = [UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000];
    [self.aheadShopButton setTintColor:[UIColor whiteColor]];
    self.aheadShopButton.layer.cornerRadius = 15.0;
    self.aheadShopButton.layer.borderColor = [UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000].CGColor;
    self.aheadShopButton.layer.borderWidth = 1.0;
    self.aheadShopButton.layer.masksToBounds = YES;
    [self.contentView addSubview:_aheadShopButton];
    
    //预告片
    self.trailerButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.trailerButton.frame = CGRectMake(imageWidth + kImageW(35) + kScreenWidth / 4, kImageH(120), kScreenWidth / 4, 30);
    [self.trailerButton setTitle:@"预告片" forState:UIControlStateNormal];
    self.trailerButton.backgroundColor = [UIColor whiteColor];
    [self.trailerButton setTintColor:[UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000]];
    self.trailerButton.layer.cornerRadius = kImageH(15);
    self.trailerButton.layer.borderColor = [UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000].CGColor;
    self.trailerButton.layer.borderWidth = 1.0;
    self.trailerButton.layer.masksToBounds = YES;
    [self.contentView addSubview:_trailerButton];
    
}

/* 本页面所有控件
 UIScrollView *self.contentView;// 滑动视图
 
 UILabel *titleLabel;       // 顶部标题
 UILabel *dateLabel;        // 日期
 UILabel *filmNameLabel;    // 影片名
 UILabel *wantedCountLabel; // 想看人数
 UILabel *typeLabel;        // 影片类型
 UILabel *directLabel;      // 导演
 UILabel *actorLabel;       // 演员
 UIButton *aheadShopButton; // 超前预售/上映提醒
 UIButton *trailerButton;   // 预告片
 UIImageView *displayImageView; // 影片海报
 */

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
